//
//  RecordManager.h
//  record_plugin
//
//  Created by 3tee on 2024/9/24.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@protocol RecordManagerDelegate <NSObject>


/// 初始化回调
/// - Parameters:
///   - code: 0表示成功  其他表示错误
///   - message: 错误信息
- (void)onInitResult:(NSString *)code message:(NSString *)message;


/// 单向视频录制回调
/// - Parameters:
///   - code: 0 成功 -1001 话术列表失败 -1002 话术转语音失败 -1003 创建服务器录制失败 -1004 创建tts播放失败 -1005 播放tts失败 -1006 停止服务器录制失败
///   - message: 对应状态描述
///   - filePath: 成功filePath才有值
- (void)onRecordResult:(NSString *)code message:(NSString *)message filePath:(NSString *)filePath;


//双向视频回调接口
- (void)onGoBack;

- (void)onGoNext;

@end

@interface RecordManager : NSObject


/// 单列对象
+ (RecordManager *)sharedInstance;


/// 初始化录制
/// - Parameters:
///   - serverPath: 服务器地址
///   - delegate: 代理对象
- (void)initWithServerPath:(NSString *)serverPath delegate:(id<RecordManagerDelegate>)delegate;


/// 开始单向录制
/// - Parameters:
///   - firstFile: 身份证url
///   - similarity: 人脸对比相似度
///   - productCode: 业务code
///   - navigationController: 导航器
- (void)startRecord:(NSString *)firstFile similarity:(double)similarity product:(NSString *)productCode navigationController:(UINavigationController *)navigationController;



/// 开始双向视频认证
/// - Parameters:
///   - productId: 产品编号
///   - name: 用户名
///   - phone: 用户手机号
///   - score: 人脸检测分数
///   - applyId: id
///   - navigationController: 导航器
- (void)remote:(NSInteger )productId customerName:(NSString *)name phone:(NSString *)phone frontCheckFaceScore:(NSString *)score applyId:(NSString *)applyId navigationController:(UINavigationController *)navigationController;

/// 反初始化录制
- (void)unInit;

@end

NS_ASSUME_NONNULL_END
